home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_rotatecage.cog < prev    next >
Text File  |  1999-11-15  |  27KB  |  979 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_RotateCage.cog
  4. #
  5. # Rotate the Aethereal cage and control cutscenes for Mophia.
  6. #
  7. # [TL & revised by HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. message        startup        
  16. message        pulse        
  17. message        user0                                            # Mophia's intro cutscene        
  18. message        user1                                            # we're dilating
  19. message        killed                                            # Matt sez okay to zap her
  20. ## message        user2                                            # (temp in place of killed)    
  21. message        user3                                            # okay to shrink
  22.  
  23. # Spinning cage links ..........................................................
  24.  
  25. thing        soph                                    nolink    # Added for attachment purposes        
  26.  
  27. cog            sophiaspincog
  28.  
  29. # Cutscene stuff:
  30.  
  31. # Keyframes ....................................................................
  32.  
  33. keyframe    so_stand=0so_stand_startled.key            local
  34.  
  35. # Models .......................................................................
  36.  
  37. model        mod_nomedal=torso_wm_nogem.3do            local
  38.  
  39. # Sounds .......................................................................
  40.  
  41. sound        cageloop=gen_cage_loop.wav                local        # Cage loop
  42. sound        cagedrop=gen_cage_ascend.wav            local        # Cage drop
  43. sound        leak=aet_reality_leak.wav                local        # Reality leak sound
  44. sound        jones=at04s03.wav                        local        # "Jones!..."
  45. sound       majesty=at04j07.wav                        local        # "Your aetherial majesty"
  46. sound       musicA=mus_inf_cutscene1e.wav            local        # Merge music
  47. sound       musicB=mus_gen_machinepart.wav            local        # Leakage music
  48. sound        mardukloop=aet_mr_fly.wav                local        # Marduk fly.
  49. sound        explode=aet_cage_explode.wav            local        # Cage explode.
  50. sound        create=aet_mophia_creation.wav            local        # Mophia creation.
  51. sound        defeat=aet_moph_screech.WAV                local        # Mophia defeat.
  52. sound        hurt=aet_moph_hurt.wav                    local        # Mophia hurt.
  53. sound        mardukhurt=aet_mr_defeat.wav            local        # Marduk hurt.
  54. sound        cagestop=gen_cage_powerup.wav            local        # At end of cage travel.
  55. sound        mardukswoop=mus_aet_mardukswoops.wav    local        # Marduk's entrance.
  56. sound        mophiarise=aet_moph_rise.WAV            local        # Mophia's rise.
  57. sound        mophiasnarl=aet_moph_fireball.wav        local        # Focus sound for eyes.
  58. sound        shrink=aet_cage_explode.wav                local        # Shrink sound.
  59. sound        rumble=pru_boulder_rolling_c.wav        local
  60. sound        shrinkhurt=aet_mr_damaged.wav            local
  61.  
  62. # Actors .......................................................................
  63.  
  64. thing        player                                    local
  65. thing        cage                                            # Aet cage
  66. thing        marduk
  67. thing        soph2                                            # Sophia after cage has opened
  68. thing        dais_open                                nolink    # Cage dais    open
  69. thing        dais_close                                nolink    # Cage dais    close
  70. thing        indy0                                            # Indy actors for leakage scene
  71. thing        indy1
  72. thing        indy2
  73.  
  74. thing        stage_1                                    nolink    # stage wedges
  75. thing        stage_2                                    nolink
  76. thing        stage_3                                    nolink
  77.  
  78. # Cameras ......................................................................
  79.  
  80. thing        cam0                                    nolink    # Camera for cage descent
  81. thing        cam1                                    nolink    # Cam A for M descent
  82. thing        cam2                                    nolink    # Cam B for M descent
  83. thing        cam3                                    nolink  # Cam for Sophia closeup and spin
  84. thing        cam4                                    nolink    # Cam for Merge
  85. thing        cam5                                    nolink    # Cam for Mophia closeup
  86. thing        cam6                                    nolink    # Cam for Mophia 1st attack mark
  87. thing        cam7                                    nolink    # Mophia death
  88.  
  89. thing        shrinkCam                                nolink
  90. thing        followcamspot                            nolink
  91. thing        followcamtarg                            nolink
  92.  
  93. # Marks & Targets ..............................................................
  94.  
  95. thing        cg_mk_1                                    nolink    # Target for cage
  96. thing        mar_mk_1                                nolink    # target for Marduk
  97. thing        mar_mk_2                                nolink    # target for Marduk
  98. thing        mar_mk_3                                nolink    # target for Marduk
  99. thing        mar_mk_4                                nolink    # target for Marduk
  100. thing        moph_mk_1                                nolink    # Mo high mark
  101. thing        moph_mk_2                                nolink  # Mo shrink mark
  102. thing        moph_mk_3                                nolink    # Mo zap mark
  103. thing        soph_mk_1                                nolink    # Where Sophia returns...
  104.  
  105. thing        moph_look_target                        nolink    # Look target for Mophia
  106.  
  107. thing        boss_ghost                                        # create Mo boss @ Waypnt_0
  108.  
  109. thing        offset_target0                                    # leak cam 0 spot
  110. thing        offset_target1                                    # leak cam 1 spot
  111. thing        offset_target2                                    # leak cam 2 spot
  112.  
  113. thing        lookOff_target0                                    # leak cam 0 aim
  114. thing        lookOff_target1                                    # leak cam 1 aim
  115. thing        lookOff_target2                                    # leak cam 2 aim
  116.  
  117. thing        movePOS0                                        # leak cam 0 moves here
  118. thing        movePOS1                                        # leak cam 1 moves here
  119. thing        movePOS2                                        # leak cam 2 moves here
  120.  
  121. thing        targetPOS0                                        # leak aim 0 moves here
  122. thing        targetPOS1                                        # leak aim 1 moves here
  123. thing        targetPOS2                                        # leak aim 2 moves here
  124.  
  125. thing        marduk_trgt_0                            nolink    # glued to Marduk
  126. thing        marduk_trgt_1                            nolink    # follow Mar to here
  127. thing        mohead_trgt                                nolink    # Mo close up
  128.  
  129. thing        spriteDummy                                nolink    # cage vanishes
  130. thing        spriteDummy1                            nolink    # big M appears
  131. thing        spriteDummy2                            nolink    # 1st shrink
  132. thing        spriteDummy3                            nolink    # 2nd shrink
  133. thing        spriteDummy4                            nolink    # 3rd shrink
  134. thing        spriteDummy5                            nolink    # Sophia reappears
  135.  
  136. thing        ghost_loop                                        # POS ghost for cage loop sound.
  137.  
  138. # Variables ....................................................................
  139.  
  140. thing        head                                    local
  141. thing        offtarg                                    local
  142. thing        mophia                                    local
  143. thing        spriteThing                                local
  144. thing        spriteThing1                            local
  145. thing        spriteThing2                            local
  146. thing        indyvar                                    local
  147. thing        offcamvar                                local    
  148. thing        looktargvar                                local
  149. thing        camposvar                                local
  150. thing        targposvar                                local
  151. thing        spritevar                                local
  152. thing        stagevar                                local
  153.  
  154. sector        camsector                                local
  155.  
  156. vector        headvec                                    local
  157. vector        v_camspot                                local
  158.  
  159. flex        viewangle                                local
  160. flex        mophiazap                                local    # label
  161. flex        cageloop                                local
  162.  
  163. int            curcam                                    local    
  164. int            gomovie=0                                local
  165. int            so_keytrack1                            local
  166. int            mr_colltype                                local
  167. int            mo_rotrate                                local
  168. int            doleak=0                                local
  169. int            shrinknow=0                                local
  170. int            shrinkcount=0                            local
  171. int            mophintrodone=0                            local
  172. int            channel0                                local
  173. int            mardukchannel                            local
  174. int            rumblechannel                            local
  175.  
  176. # Others .......................................................................
  177.  
  178. thing        rotate_ghost0                            nolink    # Marduk spinner
  179. thing        rotate_ghost1                            nolink    # camera spinner
  180. thing        floater0
  181. thing        floater1
  182. thing        bug0
  183. thing        bug1
  184.  
  185. template    mophSprite=aet_flash                    local    # VFX for Mo's transformation    
  186. template    mophSprite1=aet_flash                    local    # VFX for Mo's transformation    
  187. template    mophSprite2=aet_flash                    local    # VFX for Mo's transformation    
  188. template    tpl_ghost=ghost                            local    # use to create objects    
  189.  
  190. sector        mophsec                                    local
  191.  
  192. cog            cog_boss                                        # Matt's boss cog aet_AIMophia.cog
  193. cog            forgiveCog                                        # Hal's cutscene 15_AET_Forgive.cog
  194. cog         hint_cog
  195.  
  196. # Camera shake symbols .........................................................
  197.  
  198. vector      posOffset                               local        
  199. vector      angOffset                               local
  200.  
  201. int         vibe                                    local    # Int for random shake
  202. int            shake                                    local    # Int for amount of shake
  203.  
  204. end
  205.  
  206. # ==============================================================================
  207.  
  208. code
  209.  
  210. startup:
  211.  
  212.     player = GetLocalPlayerThing();
  213.     
  214.     Sleep(0.01);
  215.     call cageloop;
  216.  
  217.     SendMessage(sophiaspincog, user1);                 # Tell Sophia to start spinning.
  218.  
  219.     # Cutscene prep....
  220.     AISetCutsceneMode(marduk);
  221.     SetThingFlags(marduk, 0x80000);
  222.     AISetCutsceneMode(soph2);
  223.     SetThingFlags(soph2, 0x80000);
  224.     SetThingFlags(dais_close, 0x80000);
  225.  
  226.     # Hide stage wedges...    
  227.     SetThingFlags(stage_1, 0x80000);
  228.     SetThingFlags(stage_2, 0x80000);
  229.     SetThingFlags(stage_3, 0x80000);
  230.     
  231.     SetThingFlags(floater0, 0x80000);
  232.     SetThingFlags(floater1, 0x80000);
  233.     SetThingFlags(bug0, 0x80000);
  234.     SetThingFlags(bug1, 0x80000);
  235.        
  236.     Sleep(20.0);
  237.  
  238.     ClearThingFlags(floater0, 0x80000);
  239.     ClearThingFlags(floater1, 0x80000);
  240.     ClearThingFlags(bug0, 0x80000);
  241.     ClearThingFlags(bug1, 0x80000);
  242.  
  243.     return;
  244.  
  245. # ..............................................................................
  246.  
  247. user0:
  248.  
  249.     # NOTE: received from aet_ArmMove.cog to start Mophia intro,
  250.     # and cutscene is ALREADY UNDERWAY...
  251.  
  252.     if (mophintrodone != 0)
  253.     {
  254.         return;
  255.     }
  256.     mophintrodone = 1;
  257.  
  258.     if (floater0 > -1)
  259.         {
  260.         //SetThingFlags(floater0, 0x10000);
  261.         //DamageThing(floater0, 1000, 0x80, player);
  262.         DestroyThing(floater0);
  263.         }
  264.     if (floater1 > -1)
  265.         {
  266.         //SetThingFlags(floater1, 0x10000);
  267.         //DamageThing(floater1, 1000, 0x80, player);
  268.         DestroyThing(floater1);
  269.         }
  270.     if (bug0 > -1)
  271.         {
  272.         //SetThingFlags(bug0, 0x10000);
  273.         //DamageThing(bug0, 1000, 0x1, player);
  274.         DestroyThing(bug0);
  275.         }
  276.     if (bug1 > -1)
  277.         {
  278.         //SetThingFlags(bug1, 0x10000);
  279.         //DamageThing(bug1, 1000, 0x1, player);
  280.         DestroyThing(bug1);
  281.         }
  282.  
  283.     # TO DO:  need a big sound here as cage starts...
  284.     PlaySoundLocal(cagedrop, 1, 0, 0x0, 0);    
  285.  
  286.     # Sophia: "Jones..."
  287.     PlayVoice(soph, jones, 1.0, 0);
  288.  
  289.     # Cut to cage dropping to floor & track it...
  290.     SetCameraLookInterp(2, 0);
  291.     SetCameraPosInterp(2, 0);
  292.     SetCameraFocus(2, cam0);
  293.     SetCameraSecondaryFocus(2, cage);
  294.     SetCurrentCamera(2);
  295.     SetCameraFOV(60, 0, 0.0);
  296.     
  297.     Sleep(1.0);
  298.     SetCameraFOV(75, 1, 2.0);
  299.  
  300.     # Wait for cage to stop...
  301.     AIWaitForStop(cage);
  302.     PlaySoundLocal(cagestop, 1, 0, 0x0, 0);    
  303.     Sleep(0.3);
  304.  
  305.     # VFX play here...
  306.     spriteThing = CreateThing(mophSprite, spriteDummy);
  307.     CaptureThing(spriteThing);
  308.     AnimateSpriteSize(spriteThing, '0 0 1', '4 4 1', 0.5);
  309.  
  310.     # Hide open dais and show closed one...
  311.     ThingFadeAnim(dais_open, 1.0, 0.0, 0.5, 0);
  312.     SetThingAlpha(dais_close, 0.0);
  313.     ClearThingFlags(dais_close, 0x80000);
  314.     ThingFadeAnim(dais_close, 0.0, 1.0, 0.5, 0);
  315.     StopSound(channel0, 0.0);
  316.  
  317.     # TO DO: add a sound for this...
  318.     PlaySoundLocal(explode, 1, 0, 0x0, 0);    
  319.  
  320.     # Hide cage and Soph & reveal Soph2...
  321.     ThingFadeAnim(cage, 1.0, 0.0, 1.0, 0);
  322.     ThingFadeAnim(soph, 1.0, 0.0, 1.0, 0);
  323.     SetThingAlpha(soph2, 0.0);
  324.     ClearThingFlags(soph2, 0x80000);
  325.     so_keytrack1 = PlayKey(soph2, so_stand, 2, 0x00, 0);
  326.     ThingFadeAnim(soph2, 0.0, 1.0, 1.0, 0);
  327.     Sleep(0.5);
  328.     AnimateSpriteSize(spriteThing, '4 4 1', '5 5 0', 0.5);
  329.  
  330.     # Sophia anticipates M...
  331.     SetThingMaxRotVel(soph2, 120.0);
  332.     AISetLookThing(soph2, cam1);
  333.     Sleep(0.5);
  334.     AIWaitForStop(soph2);
  335.     DestroyThing(spriteThing);
  336.     SetThingFlags(cage, 0x80000);
  337.     SetThingFlags(soph, 0x80000);
  338.     SetThingFlags(dais_open, 0x80000);
  339.  
  340.     # Prep Marduk...
  341.     ClearThingFlags(marduk, 0x80000);
  342.     SetThingMesh(marduk, 0, mod_nomedal, 0);
  343.     mr_colltype = GetCollideType(marduk);
  344.     SetCollideType(marduk, 0);
  345.     SetThingAlpha(marduk, 0.0);
  346.  
  347.     # Cut to shot of Marduk...
  348.     mardukchannel = PlaySoundLocal(mardukloop, 1, 0, 0x0, 0);
  349.     AttachThingToThing(marduk_trgt_0, marduk);
  350.     SetCameraFocus(2, cam1);
  351.     SetCameraSecondaryFocus(2, marduk_trgt_0);
  352.     SetCameraFOV(20, 0, 0.0);
  353.  
  354.     # Marduk flies out to 1st mark...
  355.     PlaySoundLocal(mardukswoop, 1, 0, 0x0, 0);    
  356.     
  357.     ThingFadeAnim(marduk, 0.0, 1.0, 0.5, 0);
  358.     AISetMoveSpeed(marduk, 1.0);
  359.     AISetLookThing(marduk, mar_mk_1);
  360.     AISetMoveThing(marduk, mar_mk_1, 0);
  361.     Sleep(0.01);
  362.     SetCameraFOV(25, 1, 0.8);
  363.     Sleep(0.9);
  364.  
  365.     PlaySoundLocal(shrinkhurt, 1, 0, 0x0, 0);    
  366.  
  367.     # Marduk flies down to 2nd mark...
  368.     AISetMoveSpeed(marduk, 1.3);
  369.     AISetLookThing(marduk, mar_mk_2);
  370.     AISetMoveThing(marduk, mar_mk_2, 0);
  371.     Sleep(0.15); # was 0.2
  372.     
  373.     # Camera drops to track M...
  374.     DetachThing(marduk_trgt_0);
  375.     SetCameraLookInterp(2, 1);
  376.     SetCameraPosInterp(2, 1);
  377.     SetCameraInterpSpeed(2, 2.3);
  378.     Sleep(0.01);
  379.  
  380.     SetCameraFocus(2, cam2);
  381.     SetCameraSecondaryFocus(2, marduk_trgt_1);
  382.     SetCameraFOV(90, 1, 2.3);
  383.     Sleep(2.3);
  384.      
  385.     # Zoom in...
  386.     SetCameraFOV(50, 1, 5.0);
  387.  
  388.     # Marduk starts to circle Sophia...
  389.     AIWaitForStop(marduk);
  390.     AttachThingToThingEx(marduk, rotate_ghost0, 0x0C);
  391.     AIEnableHeadTracking(soph2, marduk);      
  392.     Rotate(rotate_ghost0, -400, 1, 5.0);
  393.  
  394.     # Play merge music...
  395.     PlaySoundLocal(musicA, 1.0, 0, 0x0, 0);
  396.     Sleep(5.0);
  397.  
  398.     # Cut to shot of Sophia with M in bg...
  399.     SetCameraLookInterp(2, 0);
  400.     SetCameraPosInterp(2, 0);
  401.     SetCameraFocus(2, cam3);
  402.     SetCameraFOV(100, 0, 0.0);
  403.  
  404.     # Make a target near sophia...
  405.     v_camspot = VectorAdd(VectorTransformToOrient(soph2, '0.0 0.0 0.035'), GetThingPos(soph2));    
  406.     camsector = FindNewSectorFromThing(soph2, v_camspot);
  407.     offtarg = CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  408.     CaptureThing(offtarg);
  409.     SetCameraSecondaryFocus(2, offtarg);
  410.  
  411.     # Attach cam to ghost & spin everything...
  412.     TeleportThing(marduk, mar_mk_3);
  413.     SetCameraFOV(30, 1, 5.0);
  414.     AttachThingToThingEx(marduk, rotate_ghost0, 0x0C);              
  415.     AttachThingToThingEx(cam3, rotate_ghost1, 0x0C);      
  416.     AIEnableBodyTracking(soph2, marduk); 
  417.     AIEnableBodyTracking(marduk, soph2); 
  418.     Rotate(rotate_ghost0, -490, 1, 5.0);
  419.     Rotate(rotate_ghost1, -400, 1, 5.0);
  420.     Sleep(5.0);
  421.  
  422.     # Cut to closeup of Sophia...
  423.     SetCameraFocus(2, cam4);
  424.     SetCameraFOV(40, 0, 0.0);
  425.     SetCameraSecondaryFocus(2, soph2);
  426.     Sleep(0.01);
  427.     SetCameraFOV(75, 1, 0.4);
  428.  
  429.     # Housekeeping...
  430.     DetachThing(marduk);
  431.     DetachThing(cam3);
  432.     AIDisableBodyTracking(soph2, marduk);
  433.     DestroyThing(offtarg); 
  434.  
  435.     # Marduk merges with Sophia...
  436.     TeleportThing(marduk, mar_mk_4);
  437.     SetCollideType(marduk, 0);
  438.     SetCollideType(soph2, 0);
  439.     AISetMoveSpeed(marduk, 1.5);
  440.     AISetLookThing(marduk, soph2);
  441.     AISetMoveThing(marduk, soph2, 1);
  442.  
  443.     # Fade both out...
  444.     ThingFadeAnim(marduk, 1.0, 0.0, 0.5, 0);
  445.     ThingFadeAnim(soph2, 1.0, 0.0, 0.5, 0);
  446.  
  447.     PlaySoundLocal(create, 1, 0, 0x0, 0);    
  448.  
  449.     StopSound(mardukchannel, 0.0);
  450.     
  451.     # VFX play here...
  452.     spriteThing1 = CreateThing(mophSprite1, spriteDummy1);
  453.     CaptureThing(spriteThing1);
  454.     AnimateSpriteSize(spriteThing1, '0 0 1', '4 4 1', 0.5);
  455.  
  456.     # Create Mophia!
  457.     mophia = SendMessageEx(cog_boss, 27, boss_ghost, 0, 0, 0);
  458.  
  459.     SetThingAlpha(mophia, 0.0);
  460.     ThingFadeAnim(mophia, 0.0, 1.0, 0.5, 0);
  461.     SetCameraLookInterp(2, 1);
  462.     SetCameraPosInterp(2, 1);
  463.     SetCameraInterpSpeed(2, 0.5);
  464.     Sleep(0.5);
  465.     AnimateSpriteSize(spriteThing1, '4 4 1', '5 5 0', 0.5);
  466.  
  467.     # Hide stuff...
  468.     SetThingFlags(soph2, 0x10);
  469.     SetThingFlags(marduk, 0x80000);
  470.  
  471.     # Focus on ultraboss Mophia...
  472.     SetCameraSecondaryFocus(2, mophia);
  473.  
  474.     # Zoom out...
  475.     SetCameraFOV(110, 1, 0.5);
  476.     AISetLookThing(mophia, cam4);
  477.     AIEnableHeadTracking(mophia, cam4);
  478.     Sleep(2.0);
  479.  
  480.     # Housekeeping...
  481.     SetThingFlags(soph2, 0x80000);
  482.     DestroyThing(spriteThing1);
  483.  
  484.     # Cut to Mophia closeup...
  485.     SetCameraLookInterp(2, 0);
  486.     SetCameraPosInterp(2, 0);
  487.     AISetLookThing(mophia, cam5);
  488.     AIEnableHeadTracking(mophia, cam5);
  489.     SetCameraFocus(2, cam5);
  490.     SetCameraSecondaryFocus(2, mohead_trgt);
  491.     SetCameraFOV(30, 0, 0.5); # zoom in
  492.     SendMessageEX(GetThingClassCog(mophia), user6, 0, 0, 0, 0);
  493.  
  494.     # TO DO: flashing eyes & snarl for M...
  495.     PlaySoundLocal(mophiasnarl, 1, 0, 0x0, 0);    
  496.  
  497.     Sleep(2.0);    
  498.  
  499.     SendMessageEX(GetThingClassCog(mophia), user6, 0, 0, 0, 0);
  500.  
  501.     # TO DO: flashing eyes & snarl for M...
  502.     PlaySoundLocal(mophiasnarl, 1, 0, 0x0, 0);    
  503.     
  504.     # Widen out...
  505.     SetCameraFOV(90, 1, 1.0);
  506.     Sleep(0.5);
  507.  
  508.     PlaySoundLocal(mophiarise, 1, 0, 0x0, 0);    
  509.  
  510.     # Move Mophia to her upper mark...
  511.     AttachThingToThing(mohead_trgt, mophia);
  512.     AISetMoveSpeed(mophia, 1.2); # was 1.5
  513.     AISetMoveThing(mophia, moph_mk_1, 0);
  514.     mo_rotrate = GetThingMaxRotVel(mophia);
  515.     SetThingMaxRotVel(mophia, 60.0);
  516.     AIEnableHeadTracking(mophia, player);
  517.     AISetLookThing(mophia, player);
  518.     Sleep(1.5);
  519.  
  520.     # Cut to shot of M rising...
  521.     SetCameraFocus(2, cam6);
  522.     SetCameraFOV(35, 0, 0.0);
  523.     Sleep(0.01);
  524.     SetCameraFOV(90, 1, 3.5);
  525.     AIWaitForStop(mophia);
  526.  
  527.     # Indy: "Your Aetheral Majesty!"
  528.     PlayVoice(player, majesty, 1.0, 1);
  529.  
  530.     # Back to play...
  531.     SetThingMaxRotVel(mophia, mo_rotrate);
  532.     AISetMoveSpeed(mophia, 1.0);    
  533.     SetCameraPosition(1, GetThingPos(cam6));
  534.     SetCurrentCamera(1);
  535.     ResetCameraFOV(0, 0.0);
  536.     SetCameraLookInterp(2, 0);
  537.     SetCameraPosInterp(2, 0);
  538.  
  539.     EndCutScene();
  540.     ClearActorFlags(player, 0x200000);
  541.  
  542.     # Alert Matt's boss cog so Mophia will begin attacking...
  543.     SendMessage(cog_boss, 28);
  544.  
  545.     return;
  546.  
  547. # ..............................................................................
  548.  
  549. user1:
  550.  
  551.     # NOTE: received from aet_EndDilator.cog...
  552.  
  553.     # Reality leakage & Mophia shrinkage...
  554.     
  555.     if (GetParam(0) == 1)
  556.     {
  557.         indyvar = indy0;
  558.         offcamvar = offset_target0;
  559.         looktargvar = lookoff_target0;
  560.         camposvar = movePOS0;
  561.         targposvar = targetPOS0;
  562.         spritevar = spriteDummy2;
  563.         stagevar = stage_2;
  564.         doleak = 1;
  565.     }
  566.  
  567.     if (GetParam(1) == 1)
  568.     {
  569.         indyvar = indy1;
  570.         offcamvar = offset_target1;
  571.         looktargvar = lookoff_target1;
  572.         camposvar = movePOS1;
  573.         targposvar = targetPOS1;
  574.         spritevar = spriteDummy3;
  575.         stagevar = stage_1;
  576.         doleak = 1;
  577.     }
  578.  
  579.     if (GetParam(2) == 1)
  580.     {
  581.         indyvar = indy2;
  582.         offcamvar = offset_target2;
  583.         looktargvar = lookoff_target2;
  584.         camposvar = movePOS2;
  585.         targposvar = targetPOS2;
  586.         spritevar = spriteDummy4;
  587.         stagevar = stage_3;
  588.         doleak = 1;
  589.     }
  590.  
  591.     if (doleak != 0)
  592.     {
  593.         shrinknow = 0; # prep
  594.  
  595.         # Watch reality fade in...
  596.         StartCutscene(1);
  597.         curcam = GetCurrentCamera();
  598.         viewangle = GetCameraFOV();
  599.         SetActorFlags(player, 0x200000);
  600.  
  601.         # Prep indy...
  602.         TeleportThing(indyvar, player);
  603.         CopyPlayerHolsters(player, indyvar);
  604.         SetThingFlags(player, 0x80000); 
  605.         ClearThingFlags(indyvar, 0x80000);
  606.  
  607.         # Offset to look at Indy...
  608.         MakeCamera2LikeCamera1(followcamspot, followcamtarg);
  609.         SetCameraLookInterp(2, 0);
  610.         SetCameraPosInterp(2, 0);
  611.         SetCameraFocus(2, followcamspot);
  612.         SetCameraSecondaryFocus(2, followcamtarg);
  613.         SetCurrentCamera(2);
  614.         SetCameraFOV(viewangle, 0, 0.0);
  615.         SetCameraLookInterp(2, 1);
  616.         SetCameraPosInterp(2, 1);
  617.         SetCameraInterpSpeed(2, 2.0); # slow to match dilation
  618.         Sleep(0.01);
  619.  
  620.         # Slide cam out...
  621.         SetCameraFocus(2, offcamvar);
  622.         SetCameraSecondaryFocus(2, looktargvar);
  623.         SetCameraFOV(110, 1, 2.0);
  624.         
  625.         # Send message to boss cog to reset Mophia...
  626.         SendMessage(cog_boss, 30);
  627.  
  628.         # Move Mophia to her mark...
  629.         AISetCutsceneMode(mophia);
  630.         
  631.         TeleportThing(mophia, moph_mk_1);        
  632.         AISetLookThing(mophia, offcamvar);
  633.         
  634.         Sleep(2.0);
  635.  
  636.         shake = 1;
  637.         SetPulse(0.1);
  638.  
  639.         # Turn Indy to watch the leakage...
  640.         rumblechannel = PlaySoundLocal(rumble, 1.0, 0, 0x1, 0);
  641.         
  642.         SetThingMaxRotVel(indyvar, 180.0);
  643.         AIEnableBodyTracking(indyvar, looktargvar);
  644.  
  645.         SetCameraLookInterp(2, 0);
  646.         SetCameraPosInterp(2, 0);
  647.         Sleep(2.0);
  648.  
  649.         # Camera watches leakage too...
  650.         MoveThingToPos(looktargvar, GetThingPos(targposvar), 6.5);
  651.         Sleep(2.5);
  652.         MoveThingToPos(offcamvar, GetThingPos(camposvar), 4.0);
  653.         SetCameraFOV(90, 1, 4.0);
  654.         Sleep(2.0);
  655.  
  656.         StopSound(rumblechannel, 1.0);
  657.         PlaySoundLocal(leak, 1.0, 0, 0, 0);
  658.         
  659.         # M descends...
  660.         AISetMoveThing(mophia, moph_mk_2, 0);
  661.         Sleep(2.0);
  662.         
  663.         # Stage wedge appears...
  664.         ClearThingFlags(stagevar, 0x80000);
  665.         SetThingAlpha(stagevar, 0.0);
  666.         ThingFadeAnim(stagevar, 0.0, 1.0, 1.0, 0);
  667.         SetThingLight(stagevar, '0.5 0.5 0.5', 0.001, 0.1);
  668.  
  669.         # TO DO:  add sound for stage appearing...
  670.         Sleep(0.8);
  671.  
  672.         doleak = 0;
  673.         SetPulse(0.0);
  674.  
  675.         while (shrinknow == 0)
  676.         {
  677.             # Wait until signal for shrink to happen...
  678.             Sleep(0.01);
  679.         }
  680.         
  681.         # Watch Mophia shrink...
  682.         SetCameraLookInterp(2, 1);
  683.         SetCameraInterpSpeed(2, 1.0);
  684.         Sleep(1.0);
  685.         SetCameraSecondaryFocus(2, moph_mk_2);
  686.         SetCameraFOV(40, 1, 1.0);
  687.  
  688.         # Boss agony...
  689.         SendMessageEX(GetThingClassCog(mophia), user6, 2, 0, 0, 0);        # Request fan explosion VFX
  690.         PlayMode(mophia, 76, 0);
  691.         PlaySoundLocal(shrinkhurt, 1, 0, 0x0, 0);    
  692.         PlaySoundLocal(hurt, 1, 0, 0x0, 0);    
  693.         Sleep(0.2);
  694.  
  695.         PlaySoundLocal(shrink, 1, 0, 0x0, 0);    
  696.  
  697.         # VFX play here...
  698.         spriteThing2 = CreateThing(mophSprite2, spritevar);
  699.         CaptureThing(spriteThing2);
  700.         AnimateSpriteSize(spriteThing2, '0 0 1', '4 4 1', 0.7);
  701.  
  702.         Sleep(0.7);
  703.  
  704.         AnimateSpriteSize(spriteThing2, '4 4 1', '5 5 0', 0.3);
  705.         Sleep(1.3);
  706.  
  707.         # Send message to Matt's cog to shrink her...
  708.         mophia = SendMessageEx(cog_boss, 29, 0, 0, 0, 0);
  709.  
  710.         # Play music...
  711.         PlaySoundLocal(musicB, 1.0, 0, 0x0, 0);
  712.         
  713.         # Back to play...
  714.         DestroyThing(spriteThing2);
  715.         TeleportThing(player, indyvar);
  716.         SetThingFlags(indyvar, 0x80000);
  717.         ClearThingFlags(player, 0x80000);
  718.  
  719.         v_camspot = VectorAdd(VectorTransformToOrient(player, '0.15 -0.02 0.02'), GetThingPos(player));    
  720.         SetCameraPosition(1, v_camspot);
  721.         SetCurrentCamera(1);
  722.         ResetCameraFOV(0, 0.0);
  723.  
  724.         //if (gomovie == 1)
  725.         //{
  726.         //SetThingFlags(dais_close, 0x80000);
  727.  
  728.             #### TEMP FOR TESTING ####
  729.             //goto mophiazap;
  730.             ####
  731.             
  732.         //}
  733.  
  734.         EndCutScene();
  735.         ClearActorFlags(player, 0x200000);
  736.         
  737.         # Tell Matt's boss cog that Mophia should resume attacking...
  738.         AIClearCutsceneMode(mophia);
  739.         SendMessage(cog_boss, 28);
  740.         
  741.         doleak = 0;
  742.         shrinknow = 0; # reset
  743.     }
  744.  
  745.     return;
  746.  
  747. # ..............................................................................
  748.  
  749. killed:
  750.  
  751. //user2: # (temp)
  752.     if (GetSenderRef() == cog_boss)
  753.     {
  754.         //gomovie = 1;
  755.         SetThingFlags(dais_close, 0x80000);
  756.         
  757.         goto mophiazap;
  758.     }
  759.     if (GetSenderRef() == floater0)
  760.     {
  761.         floater0 = -1;
  762.     }
  763.     if (GetSenderRef() == floater1)
  764.     {
  765.         floater1 = -1;
  766.     }
  767.     if (GetSenderRef() == bug0)
  768.     {
  769.         bug0 = -1;
  770.     }
  771.     if (GetSenderRef() == bug1)
  772.     {
  773.         bug1 = -1;
  774.     }
  775.  
  776.     return;
  777.  
  778. # ..............................................................................
  779.  
  780. user3:
  781.  
  782.     # NOTE: received from aet_EndDilator.cog when it's okay to shrink Mophia...
  783.  
  784.     shrinknow = 1;
  785.  
  786.     return;
  787.  
  788. # ..............................................................................
  789.  
  790. mophiazap:
  791.  
  792.     #### TEMP FOR TEST #### if (GetSenderRef() == cog_boss) 
  793.     #### {
  794.  
  795.     # Once Mophia is killed, destroy her and begin "Forgive" scene...
  796.     
  797.     # Prep...
  798.     SetActorFlags(player, 0x200000);
  799.     DeselectWeapon(player);
  800.     StartCutscene(2);
  801.  
  802.     # Mophia...
  803.     SendMessage(cog_boss, 30);                                        # reset big M
  804.     SendMessageEX(GetThingClassCog(mophia), user6, 3, 0, 0, 0);        # Request start death VFX
  805.  
  806.     AISetCutsceneMode(mophia);
  807.     SetCollideType(mophia, 0);
  808.     AISetMoveSpeed(mophia, 2.0);
  809.     AISetLookThing(mophia, moph_mk_2);
  810.     AISetMoveThing(mophia, moph_mk_2, 0);
  811.  
  812.     # Cut to show her...
  813.     SetCameraLookInterp(2, 0);
  814.     SetCameraPosInterp(2, 0);
  815.     curcam = GetCurrentCamera();
  816.     ResetCameraFOV(0, 0.0);
  817.     SetCameraFocus(2, cam7);
  818.     SetCameraSecondaryFocus(2, mophia);
  819.     SetCurrentCamera(2);
  820.     SetCameraFOV(90, 0, 0.0);
  821.     Sleep(0.01);
  822.     SetCameraFOV(70, 1, 1.0);
  823.     AIWaitForStop(mophia);
  824.  
  825.     # M rises...
  826.     PlaySoundLocal(mardukhurt, 1, 0, 0x0, 0);    
  827.     AISetLookThing(mophia, moph_mk_1);
  828.     AISetMoveThing(mophia, moph_mk_1, 0);
  829.     AIWaitForStop(mophia);
  830.  
  831.     # M spins...
  832.     v_camspot = VectorAdd(VectorTransformToOrient(mophia, '0.2 0.2 0.0'), GetThingPos(mophia));    
  833.     camsector = FindNewSectorFromThing(moph_mk_1, v_camspot);
  834.     offtarg = CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  835.     CaptureThing(offtarg);
  836.     AttachThingToThing(offtarg, moph_mk_1);
  837.     AIEnableBodyTracking(mophia, offtarg);    
  838.     Rotate(moph_mk_1, 980, 1, 5.0);
  839.     Sleep(0.5);
  840.     
  841.     PlaySoundLocal(defeat, 1, 0, 0x0, 0);    
  842.  
  843.     # Mophia drops...
  844.     AISetMoveSpeed(mophia, 1.5);
  845.     AISetMoveThing(mophia, soph_mk_1, 0);
  846.     SetCameraFOV(110, 1, 2.0);
  847.     AIWaitForStop(mophia);
  848.  
  849.     SendMessageEX(GetThingClassCog(mophia), user6, 4, 0, 0, 0);        # Request end death VFX
  850.  
  851.     PlaySoundLocal(explode, 1, 0, 0x0, 0);    
  852.     # VFX here...
  853.     spriteThing2 = CreateThing(mophSprite2, spriteDummy5);
  854.     CaptureThing(spriteThing2);
  855.     AnimateSpriteSize(spriteThing2, '0 0 1', '5 5 1', 0.7);
  856.     Sleep(0.7);
  857.     DestroyThing(offtarg);
  858.     DestroyThing(mophia);
  859.     AnimateSpriteSize(spriteThing2, '5 5 1', '6 6 0', 0.3);
  860.  
  861.     //v_camspot = VectorAdd(VectorTransformToOrient(player, '0.2 -0.05 0.0'), GetThingPos(player));
  862.     //SetCameraPosition(1, v_camspot); 
  863.     //SetCurrentCamera(1);
  864.     ResetCameraFOV(0, 0.0);
  865.     //EndCutScene();
  866.     //ClearActorFlags(player, 0x200000);
  867.  
  868.     SendMessage(forgiveCog, user0);
  869.     SendMessage(hint_cog, user2);
  870.     
  871.     #### }
  872.  
  873.     return;
  874.  
  875. # ..............................................................................
  876.  
  877. pulse:
  878.  
  879.     vibe = RandBetween(1, 4);
  880.     if (vibe == 1)
  881.         {
  882.         if (shake == 1)
  883.             {
  884.             posOffset = '-0.008 0.00 -0.002'; #1 was .005x
  885.             angOffset = '0.00 -0.002 0.002';
  886.             }
  887.         if (shake == 2)
  888.             {
  889.             posOffset = '0.01 -0.01 0.005'; #2
  890.             angOffset = '0.005 0.00 -0.005';
  891.             }
  892.         if (shake == 3)
  893.             {
  894.             posOffset = '0.01 0.02 -0.02'; #3
  895.             angOffset = '-0.01 0.01 -0.01';
  896.             }
  897.         }
  898.     if (vibe == 2)
  899.         {
  900.         if (shake == 1)
  901.             {
  902.             posOffset = '0.008 -0.005 0.002'; #2 was .005x
  903.             angOffset = '0.002 0.00 -0.002';
  904.             }
  905.         if (shake == 2)
  906.             {
  907.             posOffset = '0.005 0.01 -0.01'; #3
  908.             angOffset = '-0.005 0.005 -0.00';
  909.             }
  910.         if (shake == 3)
  911.             {
  912.             posOffset = '-0.02 0.00 0.02'; #4 was .01x
  913.             angOffset = '0.00 0.00 0.01';
  914.             }
  915.         }
  916.     if (vibe == 3)
  917.         {
  918.         if (shake == 1)
  919.             {
  920.             posOffset = '0.005 0.005 -0.005'; #3 was .002x
  921.             angOffset = '-0.002 0.005 -0.005';
  922.             }
  923.         if (shake == 2)
  924.             {
  925.             posOffset = '-0.015 0.00 0.01'; #4 was .01x
  926.             angOffset = '0.00 0.00 0.01';
  927.             }
  928.         if (shake == 3)
  929.             {
  930.             posOffset = '-0.025 0.00 -0.01'; #1 was .02x
  931.             angOffset = '0.00 -0.01 0.01';
  932.             }
  933.         }
  934.     if (vibe == 4)
  935.         {
  936.         if (shake == 1)
  937.             {
  938.             posOffset = '-0.002 0.00 0.005'; #4
  939.             angOffset = '0.00 0.00 0.002';
  940.             }
  941.         if (shake == 2)
  942.             {
  943.             posOffset = '-0.01 0.00 -0.005'; #1
  944.             angOffset = '0.00 -0.005 0.005';
  945.             }
  946.         if (shake == 3)
  947.             {
  948.             posOffset = '0.02 -0.02 0.01'; #2
  949.             angOffset = '0.01 0.00 -0.01';
  950.             }
  951.         }
  952.     vibe = RandBetween(1, 3);
  953.     if (vibe == 1)
  954.         {
  955.         SetPulse(0.05);
  956.         }
  957.     if (vibe == 2)
  958.         {
  959.         SetPulse(0.1);
  960.         }
  961.     if (vibe == 3)
  962.         {
  963.         SetPulse(0.15);
  964.         }
  965.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  966.  
  967.     return;
  968.  
  969. # ..............................................................................
  970. cageloop:
  971.  
  972.     channel0=PlaySoundThing(cageloop, cage, 1, 10, 20, 0x0081);
  973.     //channel0=PlaySoundLocal(cageloop, 1.0, 0, 0x1, 0);
  974.     
  975.     return;
  976.  
  977. # ..............................................................................
  978. end
  979.